@include('layout.header')
<script src="{{ URL::asset('public_js/jquery-3.2.1.min.js') }}"></script>
<link href="{{ URL::asset('rankinglist/css/active.css')}}" rel="stylesheet">
<style>
    #mask {
        z-index: 12;
    }
</style>
<div class="l_active">
    <div class="l_tab">
        <div class="l_subtab">
            <ul>
                <li><a href="{{url::asset('/bdlists')}}" style="color: #f3b0bb;">策略大师榜</a></li>
                <li class="line"></li>
                <li class="l_a">明日之星榜</li>
            </ul>
        </div>
    </div>
    <div class="l_main">
        <ul>
            <li></li>
            <li>
                <!-- banner -->
                <div id="l_wrapper" style="margin:0 auto;">
                    <div id="l_slide_photo">
                        <a target="_blank" class="first" index="1"></a>
                        <a target="_blank" class="second" index="2"></a>
                        <a target="_blank" class="third" index="3"></a>
                        <a target="_blank" class="fourth" index="4"></a>
                        <a target="_blank" class="fifth" index="5"></a>
                    </div>
                    <div id="l_slide_foot">
                        <div id="slideshow_footbar"></div>
                    </div>
                </div>
                <!-- 标题栏 -->
                <div class="l_title">
                    <div class="l_subtitle">
                        <ul>
                            <li class="current" id="topaiming">比赛排名</li>
                            <li id="tojiangxiang">奖项设置</li>
                            <li id="toguize">赛事规则</li>
                            <li>PK大师</li>
                            <li id="toyaoqing">邀请好友</li>
                        </ul>
                    </div>
                </div>
                <!-- 奖金池 -->
                <div class="l_perNum">
                    <div class="l_person clearfix">
                        <span>本周奖金池¥10000.00</span>
                        <span>已参与人次{{$allnum}}人</span>
                    </div>
                    <div>(每人每周不少于10单，周盈不少于100点，方可领取奖金)</div>
                </div>
                <!-- 赛程安排 -->
                <div class="l_arrange">
                    <div class="l_arr">
                        <div class="l_icon">
                            赛程安排
                        </div>
                        <div class="sche_arrange">
                            <div class="scrolllist" id="slid1">
                                <a id="aleft" class="abtn aleft" href="javascript:void(0);" title="左移" style="background-color:rgb(247, 51, 83)"></a>
                                <div class="l_schlist">
                                    <ul class="schlist" style="left: -{{($ingindex-1)*280+($ingindex-1)*26}}px;">
                                        @foreach($activelist as $akey=>$aval)
                                            <li class="@if($aval['active_status'] == 1) start @elseif($aval['active_status'] == 2) end @else @endif" name="weekRank" @if($aval['active_status'] == 2) onclick="showWeekRank('{{$aval['start_time']}}','{{$aval['end_time']}}')" @endif>
                                                <div class="qs_time">
                                                    <p><span>比赛开始时间：</span>{{$aval['start_time']}} 5:00:00</p>
                                                    <p><span>比赛结束时间：</span>{{$aval['end_time']}} 5:00:00</p>
                                                </div><h3 class="state">— @if($aval['active_status'] == 1)进行中@elseif($aval['active_status'] == 2)已结束@else未开始@endif —</h3>
                                                <div class="winnerbox clearfix">
                                                    @if($aval['active_status'] == 2)
                                                        @foreach($aval['weekinfo']  as $infokey=>$infoval)
                                                        <div class="item first">
                                                            <i class="win_icon @if($infoval->ranking == 1) win_1 @elseif($infoval->ranking == 2) win_2 @else win_3 @endif"></i>
                                                            <a class="winner_link" title="{{$infoval->username}}">
                                                                <div class="winimgbox">
                                                                    <img width="64" height="64" src="@if($infoval->photo) {{$infoval->photo}} @else {{ URL::asset('/rankinglist/images/user_tx.png') }}@endif" alt="头像" />
                                                                </div><h4 class="win_name">{{$infoval->username}}</h4></a>
                                                        </div>
                                                        @endforeach
                                                    @else
                                                        <div class="item second">
                                                            <i class="win_icon win_1"></i>
                                                            <a class="winner_link" title="西部小哥">
                                                                <div class="winimgbox">
                                                                    <img width="64" height="64" src="{{ URL::asset('/rankinglist/images/user_tx.png') }}" alt="头像" />
                                                                </div><h4 class="win_name"></h4></a>
                                                        </div>
                                                        <div class="item second">
                                                            <i class="win_icon win_2"></i>
                                                            <a class="winner_link" title="西部小哥">
                                                                <div class="winimgbox">
                                                                    <img width="64" height="64" src="{{ URL::asset('/rankinglist/images/user_tx.png') }}" alt="头像" />
                                                                </div><h4 class="win_name"></h4></a>
                                                        </div>
                                                        <div class="item third">
                                                            <i class="win_icon win_3"></i>
                                                            <a class="winner_link" title="西部小哥">
                                                                <div class="winimgbox">
                                                                    <img width="64" height="64" src="{{ URL::asset('/rankinglist/images/user_tx.png') }}" alt="头像" />
                                                                </div><h4 class="win_name"></h4></a>
                                                        </div>
                                                    @endif
                                                </div>
                                                <p title="EAI分析策略大赛一期第一周比赛" class="item_foot">EAI分析策略大赛一期第{{$akey+1}}周比赛</p>
                                            </li>
                                        @endforeach
                                    </ul>
                                </div>
                                <a id="aright" class="abtn aright" href="javascript:void(0);" title="右移" style="background-color:rgb(247, 51, 83)"></a>
                            </div>   
                        </div>
                    </div>
                      <!-- 周榜弹框 -->
                    <div class="l_weekBox" id="l_weekBox">
                        <div class="l_close" onclick="hideWeekRank()"></div>
                        <div class="l_con" id="l_con">
                        </div>
                    </div>
                </div>
                <!-- 比赛排名 -->
                <div class="l_ranking" id="paiming">
                    <div class="l_rank">
                        <div class="l_countdown">
                            <script>
                                $(function(){
                                    timer = setInterval("daojishi()", 1000);
                                })
                            </script>
                        </div>
                        <iframe name="gameRank" id="gameRank" src="{{ '/gameranking' }}" width="100%" height="900px" scrolling="no" frameborder="0"></iframe>
                        <!-- 周榜-分析师周界面开始lang -->
                        <div class="l_weekBang" id="l_weekBang" style="z-index:15;">
                        </div>
                        <!-- 周榜-分析师周界面结束lang -->
                    </div>
                </div>
                <!-- 奖项设置 -->
                <div class="l_setting" id="jiangxiang">
                    <div class="l_priceset">
                        <span>奖项设置</span>
                        <img src="{{ URL::asset('/rankinglist/images/prizesettings.jpg') }}" alt="">
                    </div>
                </div>
                <!-- 赛事规则 -->
                <div class="l_racerule" id="guize">
                    <div class="l_rule">
                        <div class="l_title">赛事规则</div>
                        <img src="{{ URL::asset('/rankinglist/images/tradrules.png') }}" alt="">
                    </div>
                </div>
                <!-- 外汇交易大赛 -->
                <div class="l_advertising" id="yaoqing">
                    <div class="l_link">
                        <img src="{{ URL::asset('/rankinglist/images/copylink.png') }}" alt="">
                        <div class="l_search">
                            <input type="text" id="val" readonly value="八千万分析策略大赛邀您一起参加！！！ http://www.eaifx.com/active"/>
                            <input type="button" value="复制链接" id="cp-btn" data-clipboard-action="copy" data-clipboard-target="#val">
                        </div>
                        <div class="l_tip">复制完链接，你可以通过QQ、微信、E-MAIL等发送给你的小伙伴</div>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</div>
<!-- 扫码加群开始  lang -->
<!--<div class="l_qrcode">
    <img src="{{URL::asset('/rankinglist/images/radius_focus.png')}}" alt="" class="code_img">
</div>
 扫码加群结束  lang 
<div id="returnTop" class="returnTop">
    <img src="{{URL::asset('/rankinglist/images/returnTop.png')}}" alt="">
</div>-->

<!-- 开奖啦 -->
<div class="j_zhezhao" id="j_zhezhao" ></div>
<div class="j_Award" id="j_Award">
    <img src="{{URL::asset('/index/images/award.png')}}" alt="">
    <div  id="j_Close"><img src="{{URL::asset('/index/images/j_close.png')}}" alt=""></div>
    <a href="{{url::asset('/cash')}}" id="view_now">立即查看</a>
</div>

<!-- 周五结算通知 -->
<div class="zhao" id="zhao"></div>
<div class="info" id="info">
    <img src="{{URL::asset('/index/images/info.png')}}" alt="">
    <div  id="infoClose"><img src="{{URL::asset('/index/images/j_close.png')}}" alt=""></div>  
</div>

</body>

<script src="{{ URL::asset('rankinglist/js/active.js')}}"></script>
<script src="{{ URL::asset('public_js/jquery-3.2.1.min.js') }}"></script>
<script src="{{ URL::asset('public_js/jquery.nicescroll.min.js') }}"></script>
<script src="{{ URL::asset('js/layer/layer.js') }}"></script>
<script src="{{URL::asset('public_js/clipboard.min.js')}}"></script>
<script>
    var rankinglist = '{{url("ranking")}}';
    var endtime   = '{{ $end_time }}';
    var starttime = '{{ $start_time }}';
    var ingindex  = '{{$ingindex}}';
    function daojishi() {  //距离本周结束时间倒计时
        clearInterval(timer);
        var nowtime = Date.parse(new Date());
        if((starttime*1000) > nowtime){
            clearInterval(timer);
            $('.l_countdown').html('本周比赛未开始，敬请期待！');
        }else if((endtime*1000) < nowtime){
            clearInterval(timer);
            $('.l_countdown').html('本周比赛已结束');
        }else{
            var leftTime = (endtime * 1000 - nowtime) / 1000;
            var day = Math.floor(leftTime / 60 / 60 / 24); //计算剩余的天数
            var hours = Math.floor(leftTime / 60 / 60 % 24); //计算剩余的小时
            var minutes = Math.floor(leftTime / 60 % 60);//计算剩余的分钟
            var seconds = Math.floor(leftTime % 60);//计算剩余的秒数
            msg = "<span>" + day + "</span>" + "<span>天</span>" + "<span>" + hours + "</span>" + "<span>小时</span>" + "<span>" + minutes + "</span>" + "<span>分</span>" + "<span>" + seconds + "</span>" + "<span>秒</span>";
            $('.l_countdown').html("距离本周结束时间：" + msg);
            // --leftTime;
            timer = setInterval("daojishi()", 1000);
        }
    }

//    开奖
    var today_1 = new Date().getDay();
    // var storage=window.localStorage;
        
    if(today_1 == 1){
        // if(!storage.getItem("c")){
        //     storage.setItem("c",3);
            $('#j_zhezhao').show();
            $('#j_Award').show();
            $('#j_Close').click(function(){
                $('#j_zhezhao').hide();
                $('#j_Award').hide();
            })
        // }
    }else{
        // storage.clear();
        $('#j_zhezhao').hide();
        $('#j_Award').hide();
    }
    
    
    //周五强行结算通知  --by zhao
//    var today_2 = new Date().getDay();        
//    if(today_2 == 2){
        $('#zhao').show();
        $('#info').show();
        $('#infoClose').click(function(){
            $('#zhao').hide();
            $('#info').hide();
        });
//    }else{
//        $('#zhao').hide();
//        $('#info').hide();
//    }



</script>
@include('layout.footer')
